package com.zzl.finance.data.constant;

/**
 * 用户类别0.核心企业1.供应商，2集团 3 平台 4 资方
 *
 * @author by gull
 * @date 2020/11/9 12:30
 */
public enum UserCategoryConstant {

    /**
     *
     */
    USER_CATEGORY_ENTERPRISE(0, "核心企业"),
    USER_CATEGORY_SUPPLIER(1, "供应商"),
    USER_CATEGORY_GROUP(2, "集团"),
    USER_CATEGORY_PLAT(3, "平台"),
    USER_CATEGORY_FINANCE(4, "资方"),
    ;


    private Integer key;
    private String value;

    UserCategoryConstant(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    /**
     * 通过code获取枚举对象
     *
     * @param code code值
     * @return 枚举对象
     */
    public static String getStatus(Integer code) {
        for (UserCategoryConstant value : UserCategoryConstant.values()) {
            if (value.key.equals(code)) {
                return value.value;
            }
        }
        return null;
    }

    public Integer getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
